package 高效制胜._03;

/**
 * @author yzh
 * @version 1.0
 * @date 2021/9/9 12:26
 * 爬楼梯
 * 算法：动态规划
 */
public class _70 {

    public int climbStairs(int n) {
        int a = 1, b = 1;
        for (int i = 2; i <= n; i++) {
            int tmp = b;
            b = a + b;
            a = tmp;
        }
        return b;
    }

}
